/**
 * @desc
 *
 * @使用场景
 *
 * @author  杨晓东[of1081]
 * @company qianmi.com
 * @Date    2017/3/10
 **/

import * as request from 'request';

var url = 'http://sql2.dev.qianmi.com/api/sql/exec';

request.post(url, {
    formData: {
        iid: "d6e818bb91aafff83e19b4466f1f360f",
        sql: "SELECT job_type 行业, manage_type 经营方式, SIGN_STATUS 签约状态 from qmuc.tb_user_admininfo where qmutm_ext is not null",
        src: "select job_type 行业, manage_type 经营方式, SIGN_STATUS 签约状态 from qmuc.tb_user_admininfo where qmutm_ext is not null",
        dbtype: "oracle",
        token: "of10811489117519164",
        pageIndex: 0,
        pageSize: 20,
    }, jar: getCookieJar()
}, (error, response, body) => {
    console.log(body);
});




function getCookieJar(){
    var jar = request.jar();

    // jar.setCookie(request.cookie('a9a68f4fefd3b693f10be4a89799dc48=57357846d8e6477aa2b4aae4ef29ff73'), url);
    // jar.setCookie(request.cookie('__sso_key=5755feb5017a5affdc415964939abe8e'), url);
    // jar.setCookie(request.cookie('SSOTICKET=mReYZshkizCQda7CTl8wlOQ0EaullNQIZxZIPbZRQppR31AO7_Jnjzn8foFLC_orPsnI8R2qsRSpNwBbkXxEFN2XHnAmCc6Ef58Yrjky8atjMQaGRdbsa-7p4JgQhnSCIzUh7oFRzPZP22_JiNQC8QBuSnGrl27YyrwlXN_KI3WkRl5yfhRViklBbfelheTOF00y3XocSicI7v-Ov6N8FQ..'), url);
    // jar.setCookie(request.cookie('admin_abtest=1'), url);
    // jar.setCookie(request.cookie('qmstore_abtest=0'), url);
    // jar.setCookie(request.cookie('cxuid=1078241'), url);
    // jar.setCookie(request.cookie('token=of10811489117952697'), url);
    // jar.setCookie(request.cookie('_ga=GA1.2.128862619.1489110974'), url);
    // jar.setCookie(request.cookie('__sso_key=5755feb5017a5affdc415964939abe8e'), url);
    // jar.setCookie(request.cookie('connect.sid=s%3AhEFmzg7KfuSvDZFZhAt29eCxT2FlZNaR.%2Bseo3sLSSl8HTg8PzjWl5q76vHT6A%2BO6irZcG0JoY0s'), url);
    // jar.setCookie(request.cookie('SSOEXPIRES=MjAxNy0wMy0xMCAxMjowNjoyNw..'), url);
    // jar.setCookie(request.cookie('SSOTHRESHOLD=NQ..'), url);
    //
    //
    jar.setCookie(request.cookie('token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkIjoiMTA1IiwiaSI6IiIsIm0iOiJ5YW5neGlhb2RvbmdAcWlhbm1pLmNvbSIsIm4iOiLmnajmmZPkuJwiLCJyIjoiOSwxMCIsInMiOiJvZjEwODEifQ.QW5LJrssWu0eb5kDHybLPEFB3bGFYBrO_Bay-33XwTc'), url);


    return jar;
}
